print('123', end="")
print('456')
num = ("dq" "me")
print(10/5)
print(2**3)
print(3>2)
print(10//5)
print(2>3)

#打印菱形
def print_diamond(n):
    # 打印上半部分
    for i in range(n):
        print(' ' * (n - i - 1) + '*' * (2 * i + 1))

    # 打印下半部分
    for i in range(n - 2, -1, -1):
        print(' ' * (n - i - 1) + '*' * (2 * i + 1))


# 调用函数，打印菱形
print_diamond(5)

#打印水仙花数
def print_sxh(n1,n2):
  result = 0
  for num in range(n1,n2):
      a = num // 100          # 百位
      b = (num // 10) % 10    # 十位
      c = num % 10            # 个位
      if num == a**3 + b**3 + c**3:
        result+=1
  return result
print(print_sxh(100,1000))

#打印九九乘法表
for i in range(1, 10):
    for j in range(1, i + 1):
        print(f"{j} * {i} = {j * i}", end='\t')
    print()

#打印完数
def is_perfect_number(n):
    factors_sum = sum(i for i in range(1, n) if n % i == 0)
    return factors_sum == n

def print_perfect_numbers(limit):
    for num in range(2, limit + 1):
        if is_perfect_number(num):
            print(num)

print_perfect_numbers(10000)

#打印质数
def is_prime(n):
    if n < 2:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return True

def print_primes(limit):
    for num in range(2, limit + 1):
        if is_prime(num):
            print(num)

print_primes(100)

#打印斐波那列数列
def fibonacci(n):
    a, b = 0, 1
    for _ in range(n):
        print(a, end=' ')
        a, b = b, a + b
fibonacci(10)

print("打印成功")
